<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

	<p:dialog id="popUpNuevoTipo" header="Horario" resizable="false"
		draggable="false" widgetVar="dlgNuevo" modal="true" width="500"
		minWidth="500" appendTo="@(body)">

		<h:form id="formNuevo" styleClass="formulario">
			<p:panel id="pnlNuevo">
				<table class="formulario">

					<tr>
						<td><h:outputText value="Tipo: " /></td>
						<td><p:selectOneMenu value="#{horarioDataManager.tipoCode}"
								style="width:100px;">
								<f:selectItem itemLabel="----" />
								<f:selectItems
									value="#{horarioDataManager.tipoList}"
									var="tip" itemLabel="#{tip.tipDescripcion}"
									itemValue="#{tip.tipCodigo}" />
							</p:selectOneMenu></td>
					</tr>

					<tr>
						<td><h:outputText value="Dia: " /></td>
						<td><p:selectOneMenu value="#{horarioDataManager.diaCode}" required="true">
								<f:selectItem itemLabel="----" />
								<f:selectItems value="#{horarioDataManager.diaList}" var="dia"
									itemLabel="#{dia.diaDescripcion}" itemValue="#{dia.diaCodigo}" />
							</p:selectOneMenu></td>
					</tr>

					<tr>
						<td colspan="2">
							<table>
								<tr>
									<td><h:outputText value="Hora Inicio: " /></td>
									<td><p:selectOneMenu
											value="#{horarioDataManager.horaDesdeCode}">
											<f:selectItem itemLabel="----" />
											<f:selectItems value="#{horarioDataManager.horaDesde}"
												var="hor" itemLabel="#{hor.descripcion}"
												itemValue="#{hor.codigo}" />
										</p:selectOneMenu></td>
									<td>:</td>
									<td><p:selectOneMenu
											value="#{horarioDataManager.minutoDesdeCode}">
											<f:selectItem itemLabel="----" />
											<f:selectItems value="#{horarioDataManager.minutoDesde}"
												var="hor" itemLabel="#{hor.descripcion}"
												itemValue="#{hor.codigo}" />
										</p:selectOneMenu></td>


									<td><h:outputText value="Hora Fin: " /></td>
									<td><p:selectOneMenu
											value="#{horarioDataManager.horaHastaCode}">
											<f:selectItem itemLabel="----" />
											<f:selectItems value="#{horarioDataManager.horaHasta}"
												var="hor" itemLabel="#{hor.descripcion}"
												itemValue="#{hor.codigo}" />
										</p:selectOneMenu></td>
									<td>:</td>
									<td><p:selectOneMenu
											value="#{horarioDataManager.minutoHastaCode}">
											<f:selectItem itemLabel="----" />
											<f:selectItems value="#{horarioDataManager.minutoHasta}"
												var="hor" itemLabel="#{hor.descripcion}"
												itemValue="#{hor.codigo}" />
										</p:selectOneMenu></td>
								</tr>
							</table>
						</td>
					</tr>

				</table>
			</p:panel>
			
			<p:panel id="pnlBotones">
				<p:commandButton id="btnGuardar" value="#{i18n['label.guardar']}" actionListener="#{horarioController.guardar}"
					oncomplete="if (args &amp;&amp; !args.validationFailed) dlgNuevo.hide()"
					process="@this,pnlNuevo" update="pnlNuevo"/>
					
				<p:commandButton value="#{i18n['label.cancelar']}" onclick="dlgNuevo.hide();" type="button" />
			</p:panel>
			
			
		</h:form>

	</p:dialog>
</ui:composition>
